< previous page page_125 next page >

Page 125
specific tasks, such as the Drawing toolbar that is in Microsoft Word. Because toolbars are becoming so common, users have come to expect them in all programs.
Fortunately, you can easily set up a toolbar in Visual Basic. In fact, Visual Basic Version 6 now has two different styles of toolbars: the standard toolbar and the newer CoolBar control.
Toolbar Basics
Although these two types of toolbars (pictured in Figure 6.11) appear different to the user, they both are used for the same purpose: to provide a set of graphical buttons to access common program functions.
The ToolBar control enables you to create six different types of buttons:
Pushbuttons that work like command buttons
Check buttons that work in an on-off mode, like a check box
Button groups that work like option buttons
Separator buttons that create spaces in the toolbar
Placeholder buttons that create empty space, allowing you to place other controls, such as combo boxes, on the toolbar
Drop-down buttons that, when clicked, offer the user a drop-down menu of choices
0125-01.jpg
Figure 6.11
The sleek-looking coolbar was first
introduced in Microsoft Internet Explorer.
To create a toolbar, you need to use multiple controls: one or more of the ToolBar controls and the ImageList control. The ImageList control contains a collection of bitmaps for use by other controls. In this case, the ToolBar control displays images from the ImageList control on its buttons. The ImageList control is part of the Microsoft Windows Common Controls 6.0 Group, discussed in Chapter 12, "Microsoft Common Controls."
sarrow.gifSee "The ImageList: A Fundamental Common Control," p. 248
To draw a ToolBar control on a form, you first need to add it to the Toolbox. To begin, right-click in an empty area of the Toolbox, and choose Components from the pop-up menu. When the Components dialog box appears, select the first group of Common controlsMicrosoft Windows Common Controls 6.0as shown in Figure 6.12. This group of controls contains the standard toolbar and the ImageList control. The CoolBar control is in the third group (Microsoft Windows Common Controls3 6.0); select this group to add the coolbar to the Toolbox.

 
< previous page page_125 next page >